- page_title "健康检查"

%h3.page-title
  健康检查
.bs-callout.clearfix
  .pull-left
    %p
  访问授权码：
  %code#health-check-token= current_application_settings.health_check_access_token
  = button_to reset_health_check_token_admin_application_settings_path,
    method: :put, class: 'btn btn-default',
    data: { confirm: '确定要重置健康检查访问授权码？' } do
    = icon('refresh')
    重置健康检查访问授权码
%p.light
  健康信息可以使用下面的方法检索为纯文本、JSON 或 XML 格式：
  %ul
    %li
      %code= health_check_url(token: current_application_settings.health_check_access_token)
    %li
      %code= health_check_url(token: current_application_settings.health_check_access_token, format: :json)
    %li
      %code= health_check_url(token: current_application_settings.health_check_access_token, format: :xml)

%p.light
  你也可以直接查询指定服务的状态：
  %ul
    %li
      %code= health_check_url(token: current_application_settings.health_check_access_token, checks: :cache)
    %li
      %code= health_check_url(token: current_application_settings.health_check_access_token, checks: :database)
    %li
      %code= health_check_url(token: current_application_settings.health_check_access_token, checks: :migrations)

%hr
.panel.panel-default
  .panel-heading
    当前状态：
    - if @errors.blank?
      = icon('circle', class: 'cgreen')
      健康
    - else
      = icon('warning', class: 'cred')
      不健康
  .panel-body
    - if @errors.blank?
      没有探测到健康问题
    - else
      = @errors
